<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f1(){
            var win=open("1.html","w1","width=400,height=400");

            // win.location="2.html";
        }
    </script>
</head>
<body>
    <button type="button" onclick="window.location='1.html'">test1</button>
    <button type="button" onclick="alert(location);">test2</button>

    <a href="javascript:;" onclick="f1();">打开</a>


</body>
</html>